﻿{extend name="base" /}

{block name="title"}<title>文章详情</title>{/block}
{block name="content"}
<style>
    .article .content li{
        border-top: 1px dashed #999;
    }

    .article .content li p:first-child{
        border-bottom: 1px dashed #ccc;
    }
     .comment-list li{
        margin-bottom: 20px;
        border: 1px solid #ccc;
    }
    .comment-list li p:first-child{
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
    }
</style>
<!--新闻详情-->
<div class="article">
    <h3>{$new.title}</h3>
    <p align="right">访问量为:
        <span style="color: red;margin-right: 10px;">{$new.view_nums} </span>发布时间:<span>{$new.add_time}</span>
    </p>
    {:htmlspecialchars_decode($new.content)}
</div>
<!--新闻评论-->
<div class="article">
    <!-- 发表评论   -->
    <div class="fb">
        <form action="comment" method="post">
            <!-- 隐藏域携带要评论新闻去评论 -->
            <input type="hidden" name="news_id" value="{$new.id}">
            <textarea name="content" id="" cols="30" rows="10"></textarea>
            <input type="submit" value="发表评论">
        </form>
    </div>
    <h6>精彩评论:</h6>
    <!-- 评论内容   -->
    <div id="comment" class="content">
        <ul class="comment-list">
            {if $comments}
            {volist name="comments" id="v"}
            <li>
                <p><span>{$v.username}</span> <span>{$v.add_time}</span></p>
                <p>{$v.content}</p>
            </li>
            {/volist}
            {/if}
        </ul>
    </div>
</div>
{/block}
